package bairui.international.controller.prize.nine;

import com.sh_lianjing.spring.web.controller.enhance.module.*;
import com.sh_lianjing.spring.web.controller.enhance.module.body.*;
import com.sh_lianjing.spring.web.controller.enhance.output.bean.*;
import bairui.international.controller.prize.nine.C_Prize_Nine_ItemManage_Edit;

/**
 *
 * Module_ItemEdit
 *
 */
class Module_ItemEdit{

	
	public Module module(
		bairui.international.model.domain.jpa.TB_PrizeItem bean
		, 
		C_Prize_Nine_ItemManage_Edit.Edit.Operate c_Prize_Nine_ItemManage_Edit_Edit_Operate
				
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return moduleTemplate(
				bean
				, 
				c_Prize_Nine_ItemManage_Edit_Edit_Operate
						
				,editors
			);
	}
	
	public Module module(
		java.util.List<bairui.international.model.domain.jpa.TB_PrizeItem> bean
		, 
		C_Prize_Nine_ItemManage_Edit.Edit.Operate c_Prize_Nine_ItemManage_Edit_Edit_Operate
				
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return moduleTemplate(
				bean
				, 
				c_Prize_Nine_ItemManage_Edit_Edit_Operate
						
				,editors
			);
	}
	
	
	/**
	 * 编辑模块
	 */
	private Module moduleTemplate(
		Object bean
		, 
		C_Prize_Nine_ItemManage_Edit.Edit.Operate c_Prize_Nine_ItemManage_Edit_Edit_Operate
				
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return
			new Module(
					new ModuleHead("奖品编辑")
					, 
					new EditModuleBody(
							bean, 
							Model.class,
							c_Prize_Nine_ItemManage_Edit_Edit_Operate, 
							Relation.relations(
								)
							,editors
						)
				);
	}
	
	/**
	 * 输入模型
	 */
	static public class Models {
		private @lombok.Getter @lombok.Setter java.util.List<Model> models = new java.util.ArrayList<>();
	}
	
	@org.springframework.stereotype.Component("bairui.international.controller.prize.nine.Module_ItemEdit$Model")
	
	static public class Model
	
	 extends bairui.international.model.domain.jpa.TB_PrizeItem
	
	 implements 
	
		com.sh_lianjing.spring.web.controller.enhance.input.InputModelable
	
	{
	
	
	
		/**
	
		 * 默认构造函数
	
		 */
	
		public Model(){}
	
	
	
		/**
	
		 * 构造函数
	
		 */
	
		public Model(
	
			bairui.international.model.domain.jpa.TB_PrizeItem bean
	
		){
	
			if(null != bean){
	
				this.setPrizeName(bean.getPrizeName());
	
				this.setRate(bean.getRate());
	
				this.setNoPrizeFlag(bean.getNoPrizeFlag());
	
				this.setOrderValue(bean.getOrderValue());
	
				this.setFileUrl(bean.getFileUrl());
	
			}
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("名称")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(1001)
	
		@org.hibernate.validator.constraints.NotBlank
	
		@javax.validation.constraints.Size(min=0, max=30)
	
		@Override
	
		public String getPrizeName() {
	
			return (String)super.getPrizeName();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("中奖概率%")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(2001)
	
		@javax.validation.constraints.NotNull
	
		@javax.validation.constraints.Max(100)
	
		@javax.validation.constraints.Min(0)
	
		@Override
	
		public Double getRate() {
	
			return (Double)super.getRate();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("非奖品标志")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(3001)
	
		@javax.validation.constraints.NotNull
	
		@Override
	
		public Boolean getNoPrizeFlag() {
	
			return (Boolean)super.getNoPrizeFlag();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("排序值")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(4001)
	
		@javax.validation.constraints.NotNull
	
		@javax.validation.constraints.Max(Integer.MAX_VALUE)
	
		@javax.validation.constraints.Min(Integer.MIN_VALUE)
	
		@Override
	
		public Integer getOrderValue() {
	
			return (Integer)super.getOrderValue();
	
		}
	
		
	
	
	
	
	
		/**
	
		 * 文件属性
	
		 */
	
		private org.springframework.web.multipart.MultipartFile fileUrlFile;
	
		
	
		/**
	
		 * 文件方法
	
		 */
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(5001)
	
		@com.sh_lianjing.model.annotation.Comment("图片")
	
		
	
		@com.sh_lianjing.validate.file.FileMax(value=10, units=com.sh_lianjing.validate.file.enums.Units.MB)
	
		@com.sh_lianjing.validate.file.FileMin(value=100, units=com.sh_lianjing.validate.file.enums.Units.B)
	
		@com.sh_lianjing.validate.file.FileType(extension={"bmp","png","jpg","jpeg"})
	
		@com.sh_lianjing.validate.file.Image
	
		public org.springframework.web.multipart.MultipartFile getFileUrlFile() {
	
			return this.fileUrlFile;
	
		}
	
		public void setFileUrlFile(org.springframework.web.multipart.MultipartFile fileUrlFile) {
	
			this.fileUrlFile = fileUrlFile;
	
		}
	
	
	
		/**
	
		 * 非继承属性
	
		 */
	
	
	
		/**
	
		 * 得到输入属性
	
		 */
	
		/** 得到名称 */
	
		public String gainPrizeName() {
	
			return this.getPrizeName();
	
		}
	
		/** 得到中奖概率% */
	
		public Double gainRate() {
	
			return this.getRate();
	
		}
	
		/** 得到非奖品标志 */
	
		public Boolean gainNoPrizeFlag() {
	
			return this.getNoPrizeFlag();
	
		}
	
		/** 得到排序值 */
	
		public Integer gainOrderValue() {
	
			return this.getOrderValue();
	
		}
	
		/** 得到图片 */
	
		public org.springframework.web.multipart.MultipartFile gainFileUrlFile() {
	
			return this.getFileUrlFile();
	
		}
	
	
	
		/**
	
		 * 转换到表单数据格式
	
		 */
	
		public java.util.Map<String, String> toFormData() throws com.sh_lianjing.serialize.json.jackson.exception.JsonException{
	
			return com.sh_lianjing.web.util.Util_Form.beanToFormDataFormat(this);
	
		}
	
	
	
	}
	
	
	
	static public class Relation
	{
		public static java.util.Map<String, java.util.List<?>> relations(
		){
			java.util.Map<String, java.util.List<?>> map = new java.util.HashMap<>();
			return map;
		}
	}
	
	
	
	/**
	 * 输出模型
	 */
	

}
